*******************************************************
* Lyle 05 Jan 11: 						              *
*	-this program serves as a base shell for all	  *
*	 stata do files					                  *
*******************************************************

* do c:/users/Jordan.Becker/Desktop/GD/20131028PubOpStratCult/do/PubOpStratCult.do*

********************************
* Standard Stata Configuration *
********************************
clear all
set mem 999m
capture log close
set logtype text
cap cd "C:\Users\ejm5\Google Drive\2017_Research\Unemployment_MILEX"
cap cd "C:\Users\Jordan.Becker\Desktop\GD\2017_Research\Unemployment_MILEX"
cap cd "\\usnatonetapp01.eur.state.sbu\profiles\beckerjm\Desktop\2017_Research\Unemployment_MILEX"
log using "log\WOTR.log", replace


*********************
* Prepare Variables *
*********************
use "dta\2017_uem", clear
sort ccode year
xtset ccode year


********************
* Analyze the Data *
********************
set more off
sort ccode year
xtset ccode year





*************DEPLOYABILITY*******************************************************************************
*Figure 5a: Bivariate Relationship between Military Burden and EDA Deployability*
#delimit;
use "dta\2017_uem", clear;
sort ccode year;
xtset ccode year;
corr eda_deployability milburden;
preserve;
keep if eda_deployability!=.;
#delimit;
twoway (lfit eda_deployability l3.milburden) 
(scatter eda_deployability l3.milburden, msymbol(diamond) mcolor(navy) msize(medsmall)), scheme(sj) note(R=0.127)
xtitle("", size(medsmall) margin(medsmall))
ytitle("", size(small) margin(medsmall))
legend(rows(2) size(vsmall) position(2) ring(0) label(1 Fitted) label(2 Observed))
title("A: All Country-Years (3-year lag on DV)", size(medlarge));
graph save output\milburden_deployability_a.gph, replace;
restore;


*Figure 5b: Mean Bivariate Relationship between Military Burden and EDA Deployability*
#delimit;
preserve;
keep if eda_deployability!=.;
collapse milburden eda_deployability, by (countryname);
corr eda_deployability milburden;

#delimit;

twoway (lfit eda_deployability milburden) 
(scatter eda_deployability milburden, msymbol(diamond) mcolor(navy) msize(medsmall) mlabsize(vsmall) mlabcolor(black) mlabel(countryname)), note (R=0.245)
xtitle("", size(medsmall) margin(medsmall))
ytitle("", size(medium) margin(medsmall))
legend(off)
title("B: Mean 2006-2014", size(medlarge));

graph save output\milburden_deployability_b.gph, replace;

#delimit;
graph combine output\milburden_deployability_a.gph output\milburden_deployability_b.gph, 
cols(3) ycommon iscale(tiny) imargin(tiny)
title("Defense Spending (%GDP)", size(medlarge) margin(medsmall) color(black) position(6))
subtitle("EDA Deployability (Deployable Land Forces/Total Military Personnel)", size(vsmall) position(9) orientation(vertical) margin(medsmall) color(black));
graph save output\milburden_deployability, replace;
restore;









